using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ManageBooks : System.Web.UI.Page
{
    string primaryKey;

    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    protected void bookListView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName.Equals("Select"))
        {
            int index = Convert.ToInt32(e.CommandArgument); // Get the index of the clicked row
            showBookDetails(index);
        }
    }

    private void showBookDetails(int rowIndex)
    {
        DetailsView bookDetailsView = ((DetailsView)this.LoginViewAdmin.FindControl("bookDetailsView"));
        bookDetailsView.PageIndex = rowIndex;
    }

}
